<template>
  <el-form ref="form" :model="form">
    <el-form-item class="box_form">
      <!-- <el-form-item class="number" label="创建人姓名">
        <el-input
          placeholder="请输入创建人姓名"
          v-model="form.username"
        ></el-input>
      </el-form-item>
      <el-form-item class="number" label="创建人ID">
        <el-input placeholder="请输入创建人ID" v-model="form.userid"></el-input>
      </el-form-item> -->
      <el-form-item class="number" label="系统模块名称">
        <el-select v-model="form.modename" placeholder="请选择系统模块">
          <el-option :label="item.modName" :value="item.modCode + ',' + item.modName" v-for="(item,index) of modelist" :key="index"> </el-option>
        </el-select>
      </el-form-item>
      <el-form-item class="number" label="发送机制编码">
        <el-input
          placeholder="请输入发送机制编码"
          v-model="form.mechanismCode"
        ></el-input>
      </el-form-item>
      <el-form-item class="number" label="发送机制描述">
        <el-input
          placeholder="请输入发送机制描述"
          v-model="form.mechanismDesc"
        ></el-input>
      </el-form-item>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">添加</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { addTopic } from "../../api.js";
import { queryAllBasemode } from "../../api.js";
export default {
  data() {
    return {
      form: {
       modename:'',//系统模块名称
      },
      modelist: []
    };
  },
  mounted() {},
  created() {
    queryAllBasemode({})
      .then(res => {
        console.log(res);
        this.modelist = res.redata;
      })
      .catch(res => {});
  },
  methods: {
    handleSelect(item) {
      console.log(item);
    },
    contractSelect(data) {
      console.log(data);
    },
    onSubmit() {
  
          // addSend({
          //   createUserId: sessionStorage.getItem("userid"),
          //   createUserName: sessionStorage.getItem("username"),
          //   mechanismCode: this.form.mechanismCode,
          //   mechanismDesc: this.form.mechanismDesc
          // })
          //   .then(res => {
          //     this.$emit("close", false);
          //     this.$message({
          //       showClose: true,
          //       message: res.remsg,
          //       type: "success"
          //     });
          //   })
          //   .catch((res = {}));
          console.log(this.form.modename)
        }
      }
};
</script>

<style scoped lang="less">
.el-form {
  /deep/.el-form-item__content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-left: 0 !important;
    .number {
      margin-right: 5%;
      margin-top: 40px;
    }
    .el-input {
      width: 40vh;
    }
    .el-form-item__label {
      font-size: 16px;
      text-align: right;
      width: 25%;
    }
  }
}
.box_form {
  margin: 40px 0 50px !important;
}
.box_textarea {
  width: 70% !important;
  /deep/.el-textarea__inner {
    height: 15vh;
    font-size: 18px !important;
  }
}
</style>
